package com.widget.wallpaper;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import android.os.SystemClock;
import android.util.Log;
import android.widget.RemoteViews;


public class WNWProvider extends AppWidgetProvider{
	private int timeInterval = 3;
	static int currentLayout = R.layout.main;
	static int currentWallpaper = R.layout.main;
	@Override
    public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
        final int N = appWidgetIds.length;

        // Perform this loop procedure for each App Widget that belongs to this provider
        for (int i=0; i<N; i++) {
            int appWidgetId = appWidgetIds[i];

            // Create an Intent to launch ExampleActivity
            Intent intent = new Intent(context, WNWService.class);
            context.startService(intent);
//            Log.d("check_point","onUpdate");
//            PendingIntent pendingIntent = PendingIntent.getService(context, 0, intent, 0);
//    		final AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
//    		alarm.cancel(pendingIntent);
//    		long interval = 1000*60;
//    		alarm.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(),interval, pendingIntent);
    		
        }
    }
}
